package com.label.grade.config.scheduled;

import com.label.Config.Logger.LogAnnotation;
import com.label.grade.service.ExtracurricularSumCalcService;
import com.label.grade.service.impl.UndergraGradeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @ClassName CaculateOfGpaAndCredit
 * @Description TODO
 * @Author 蛇蛇
 * @Date 2023/7/7 14:02
 **/
@Component
public class ScheduleTask {
    @Autowired
    UndergraGradeServiceImpl undergraGradeDoService;
    public void CaculateOfGpaAndCredit(){
        undergraGradeDoService.caculateGpaAndCredit();
    }


    @Resource
    ExtracurricularSumCalcService extracurricularSumCalcService;

    /**
     * @Description 每半年执行一次，用于更新第二课堂汇总数据的计算
     * @Strategy 每次直接重写(分页请求数据库数据根据几个字段判断数据中是否已有数据,)学生二课成绩表所有数据，然后根据这个数据重新计算
     */
    @Scheduled(cron = "0 0 0 1 3,9 *")
    @LogAnnotation(module = "定时任务" , operator = "计算二课成绩生成表")
    public void generateExtracurricularSummaryTable(){
//        extracurricularSumCalcService.setExtracurricularSum();
    }

}
